{template header}

<style>
    .hp-visited a:visited{color: #444;}
    .input-append button{font-size:12px;}
</style>
<div style="clear:both">
    <h5>
        <span class="add-on"><i class="icon-calendar"></i> 添加水印 </span>
        <span class="add-on">
            <code><a href="./?c=admin&a=watermarks">水印列表</a></code>
        </span>
    </h5>
</div>

<table class="table table-striped table-bordered table-hover"><tr><td>
<div style="clear:both;margin: 50px;">
    {if !empty($msg)}
    <div class="alert alert-warn">
        {$msg}
    </div>
    {/if}
    <form class="form-horizontal" method="post" enctype="multipart/form-data">
        <div class="control-group">
            <label class="control-label" for="demo_img">效果图<span style="color: red;">*</span></label>
            <div class="controls">
                {eval $demoImg = $watermark['demo_img'] ? $watermark['demo_img'] : '';}
                <input name="demo_imgr" type="file" id="demo_imgr" placeholder="效果图">
                <input name="demo_img" type="text" id="demo_img" style="display:none" value="{$watermark['demo_img']}">
                <div id="demo_img_show" style="margin-top:10px;{if !$demoImg}display:none{/if}"><img src="{$watermark['demo_img']}" /></div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="demo_img">素材图<span style="color: red;">*</span></label>
            <div class="controls">
                {eval $materialImg = $watermark['material_img'] ? $watermark['material_img'] : '';}
                <input name="material_imgr" type="file" id="material_imgr" placeholder="素材图">
                <input name="material_img" type="text" id="material_img" style="display:none" value="{$watermark['material_img']}">
                <div id="material_img_show" style="margin-top:10px;{if !$materialImg}display:none{/if}"><img src="{$watermark['material_img']}" /></div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputStatus"></label>
            <div class="controls">
                <input name="submit" type="submit" id="inputSubmit" class="btn btn-primary" value="提交">&nbsp;&nbsp;
                <input name="reset" type="reset" id="inputreset" class="btn btn-inverse" value="重置">
            </div>
        </div>
    </form>
</div>
</td></tr></table>

<script type="text/javascript">
    $(function(){
        $('#demo_imgr,#material_imgr').change(function(){
            var o = $(this);
            $('#' + o.attr('id') + '_show img').attr('src', o.val()).show();
        });
    });
</script>

{template footer}